package com.waves.core.config;

import com.baomidou.mybatisplus.extension.plugins.pagination.DialectModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.dialects.IDialect;

/**
 * mybatisPlus自定义构建分页sql
 */
public class CustomDialect implements IDialect {

    @Override
    public DialectModel buildPaginationSql(String originalSql, long offset, long limit) {
        // 这里可以根据你的数据库方言，构建带有OFFSET的SQL语句
        return new DialectModel(originalSql + " LIMIT " + limit+" OFFSET " + offset);
    }
}